home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "BTMain.h"
- #include "BitBtn.h"
- #include "Button.h"
- //---------------------------------------------------------------------------
-
- #pragma resource "*.dfm"
- TMainForm *MainForm;
- //---------------------------------------------------------------------------
- __fastcall TMainForm::TMainForm(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TMainForm::ShowButtonsClick(TObject *Sender)
- {
- int result;
- String text;
- if (Sender == ShowButtons || Sender == BtnsSpeedBtn)
- result = ButtonForm->ShowModal();
- else result = BitBtnForm->ShowModal();
- switch (result) {
- case mrOk : text = "OK"; break;
- case mrCancel : text = "Cancel"; break;
- case mrAbort : text = "Abort"; break;
- case mrRetry : text = "Retry"; break;
- case mrIgnore : text = "Ignore"; break;
- case mrYes : text = "Yes"; break;
- case mrNo : text = "No"; break;
- case mrAll : text = "All"; break;
- default : text = "custom";
- }
- String msgText =
- "Result: You pressed the " + text + " button.";
- Label->Caption = msgText;
-
- }
- //---------------------------------------------------------------------
- void __fastcall TMainForm::AllowAllUpBoxClick(TObject *Sender)
- {
- DrawMode->AllowAllUp = AllowAllUpBox->Checked;
- }
- //---------------------------------------------------------------------
- void __fastcall TMainForm::DrawModeClick(TObject *Sender)
- {
- String s = "Mode: ";
- TSpeedButton* button = dynamic_cast<TSpeedButton*>(Sender);
- if (button) s += button->Hint;
- if (!DrawMode->Down && !PaintMode->Down && !EraseMode->Down)
- s = "Mode: None";
- ModeLabel->Caption = s;
- }
- //---------------------------------------------------------------------